import React, { Component } from 'react';
import {
  Switch,
  Route
} from 'react-router-dom';

import TaskDetail from '../task/detail';
import ProjectList from '../project/projectlist';
import DeployingList from '../task/deploying';
import DeployedList from '../task/deployed';
import MainBar from '../leftbar/main';
import Setting from '../team/setting';
import Hosts from '../team/hosts';
import Databases from '../team/databases';

import { URL } from '../../config';

class App extends Component {
  render () {
    return (
      <div>
        <div className="drawer_nav">
          <MainBar />
        </div>
        <div className="item_box">
          <Switch>
            <Route path={URL.taskdetail_page} component={TaskDetail} />
            <Route path={URL.team_setting_page} component={Setting} />
            <Route path={URL.hosts_page} component={Hosts} />
            <Route path={URL.databases_page} component={Databases} />
            <Route path={URL.lined_page} component={DeployedList} />
            <Route path={URL.deploying_page} component={DeployingList} />
            <Route path={URL.main_page} component={ProjectList} />
          </Switch>
        </div>
      </div>
    )
  }
}

export default App;